<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>会员中心</title>
		<link rel="stylesheet" type="text/css" href="/css/base.css" />
		<link rel="stylesheet" type="text/css" href="/css/member.css" />
		<link rel="stylesheet" type="text/css" href="/css/member_orderlist.css" />
		<script src="/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="/js/search.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div id="container">
			<!--设置整个页面居中，需要设定margin并且需要设定width宽度-->
			<!--开头-->
			<% include ../template/header.html %><!--新版导航结束-->
			<!--导航结束-->
			<!--内容开始-->
			<div id="content" class="clearfix">
				<!--外层布局-->
				<!--左栏-->
				<% include ../template/member_siderlist.html %>					
				<!--会员中心主内容区域-->
				<div class="sider_right fr">
					<!--订单区域-->
					<!--无订单状态-->
					<%if(orderlist.length==0){%>
					<div class="member_order">
						<div class="member-mod-title">
							<h2>我的订单</h2>
						</div>
						<div class="member-mod-content">
							<table>
								<tr class="no-information">
									<td colspan="6">暂无订单</td>
								</tr>
							</table>
						</div>
					</div>
					<%}else{%>
					<!--有订单状态-->
					<!--标题部分-->
					<div class="member_order">
						<div class="member-mod-title">
							<h2>我的订单</h2>
						</div>
					</div>
                    <!--订单信息列表-->
					<div class="member_orderlist">
						<table id="orderlist">
							<thead>
								<tr>
									<th class="order_detail">订单详细</th>
									<th>收货人</th>
									<th class="price">金额</th>
									<th class="status">状态</th>
									<th class="operation">操作</th>
								</tr>
							</thead>
						    <%for(i=0;i<orderlist.length;i++){%>
							<!--每笔订单放在一个tbody内-->
							<tbody>
								<tr class="sep-row">
									<td></td>
								</tr>
								<tr class="tr-th">
									<td colspan="5">
										<div class="tr-th-header">
											<span class="order_time">
												<%=orderlist[i].formateorder_time%>
											</span>
											<span class="order_number">
												订单号： <b><%=orderlist[i].order_code%></b>
											</span>
											<span class="order_operate">
												您订单中的商品在不同库房，故拆分为以下订单分开配送，给您带来的不便敬请谅解。
											</span>
										</div>
										<div class="tr-th-footer">
											<span class="order_member">
												收货人：<%=orderlist[i].customer_name%>
											</span>
											<span class="order_totalprice">
												订单金额：¥<%=orderlist[i].orderamount%>
											</span>
											<span class="order_paytype">
												支付方式：<%=orderlist[i].pay_type%>
											</span>
											<span class="order_status">
												订单状态:<%if(orderlist[i].order_status==0){%>
													<a href="#">未付款</a> 
												<%}else if(orderlist[i].order_status==1){%>
													已付款
												<%}else if(orderlist[i].order_status==2){%>
													已发货
												<%}else if(orderlist[i].order_status==3){%>
													已完成
												<%}%>	
											</span>
											<span class="order_s">
												<a href="#">查看物流</a>
											</span>
										</div>
									</td>
								</tr>
								<tr class="tr-th tr-th-01">
									<td colspan="5">
										<span class="order_time">
							    			<%=orderlist[i].formateorder_time%>
							    		</span>
										<span class="order_number">
												订单号： <b><%=orderlist[i].order_code%></b> 
										</span>
										<span class="order_server">
												联系客服
										</span>
										<span class="order_s">
											<!--如果订单状态不是完成状态则订单信息不能显示删除-->
											<%if(orderlist[i].order_status==3){%>
											<a href="#">删除订单</a>
											<%}%>
										</span>
									</td>
								</tr>
								<!--每笔订单的商品列表-->
								<%for(j=0;j<orderlist[i].pdlist.length;j++){%>
								<tr class="tr_bd">
									<td>
										<div class="goods_item clearfix">
											<div class="goods_img fl">
												<img src="<%=orderlist[i].pdlist[j].product_img%>" />
											</div>
											<div class="goods_title fl">
												<a href="/product/<%=orderlist[i].pdlist[j].product_Id%>"><%=orderlist[i].pdlist[j].product_name%></a>
											</div>
											<div class="goods_num fl">
												<%=orderlist[i].pdlist[j].num%>
											</div>
											<div class="goods_repair fr">
												<a href="#">申请售后</a>
											</div>
										</div>
									</td>
									<td>
										<div class="address_tip">
											<span class="txt"><%=orderlist[i].customer_name%></span>
											<div class="tip">
												<div class="address_panel">
													<strong><%=orderlist[i].customer_name%></strong>
													<p><%=orderlist[i].address_details%></p>
												</div>
												<div class="icon_right">
												</div>
											</div>
										</div>
									</td>
									<td class="amount">
										<span>
											总额： ¥<%=orderlist[i].pdlist[j].totalprice%>
										</span>
										<span>
											<%=orderlist[i].pay_type%>
										</span>
									</td>
									<td class="status">
										<span>
											<%if(orderlist[i].order_status==0){%>
													<a href="#">未付款</a> 
												<%}else if(orderlist[i].order_status==1){%>
													已付款
												<%}else if(orderlist[i].order_status==2){%>
													已发货
												<%}else if(orderlist[i].order_status==3){%>
													已完成
												<%}%>
										</span>
										<span>
											<a href="#">订单详情</a>
										</span>
									</td>
									<td class="operate">
										<a href="/product/<%=orderlist[i].pdlist[j].product_Id%>">再次购买</a>
									</td>
								</tr>
								<%}%>
							</tbody>
							<%}%>
							
							<tfoot>
								<tr class="sep-row">
									<td></td>
								</tr>
								<tr>
									<th colspan="5"></th>
								</tr>								
							</tfoot>
						</table>
					</div>
					<!--订单区域结束-->
					<%}%>
				</div>
			</div>
			<!--内容结束-->
			<!--footer开始-->
			<% include ../template/footer.html %>				
			<!--footer结束-->
		</div>
	</body>

</html>